import request from '@/utils/request'

/**
* @description:获取部门列表
* @param {null}
* @return:一个promise的结果
*/
export function loadDepartment() {
  return request.get('/company/department')
}

/**
* @description:获取员工下拉数据
* @param {type}
* @return:
*/
export function getEmployeeSimple() {
  return request.get('/sys/user/simple')
}
/**
* @description:确认添加子部门
* @param {type}
* @return:
*/
export function addDept(data) {
  return request.post('/company/department', data)
}
// 删除子部门,需要传id
export function delDept(id) {
  return request.delete(`/company/department/${id}`)
}

// 获取当前id的信息
export function getDeptInfo(id) {
  return request.get(`/company/department/${id}`)
}

// 编辑请求
export function updateDept(data) {
  return request.put(`/company/department/${data.id}`, data)
}
